package com.whfc.quality.config;

import com.alibaba.nacos.spring.context.annotation.config.EnableNacosConfig;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySources;
import com.whfc.common.file.FilePathConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

/**
 * @author : qzexing
 * @version : 1.0
 * @date : 2020-07-29 15:02
 */
@Configuration
@NacosPropertySources(value = {
        @NacosPropertySource(dataId = "com.whfc.quality.properties", autoRefreshed = true),
        @NacosPropertySource(dataId = "com.whfc.common.properties", autoRefreshed = true)
})
public class QualityConfig {

    @Value("${spring.profiles.active}")
    private String profile;

    @Bean("msFilePathConfig")
    public FilePathConfig msFilePathConfig() {
        FilePathConfig config = new FilePathConfig("ms", profile);
        return config;
    }
}
